package com.mengdie.shuidi.ui.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mengdie.shuidi.R;
import com.mengdie.shuidi.model.TimeEntity;

import java.util.List;

/**
 * 作者：HQY on 17/8/7 16:46
 * 邮箱：hqy_xz@126.com
 */

public class IpTimeAdapter extends BaseQuickAdapter<TimeEntity, BaseViewHolder> {

    public IpTimeAdapter(List<TimeEntity> data) {
        super(R.layout.item_ip_time, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, TimeEntity item) {
        TextView mTvName = helper.getView(R.id.tv_time_name);
        mTvName.setText(item.getName());
        if (item.isShow()) {
            mTvName.setBackgroundColor(mContext.getResources().getColor(R.color.main_text_check_color));
            mTvName.setTextColor(mContext.getResources().getColor(R.color.color_white));
        } else {
            mTvName.setBackgroundColor(mContext.getResources().getColor(R.color.color_white));
            mTvName.setTextColor(mContext.getResources().getColor(R.color.color_444444));
        }


    }
}
